QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Spot Lights

Labels

ASCII
SpotLight
Binary
spot ( = 0x73706F74 )

Data Format

Point3D             location
Vector3D            orientation
Boolean             castsShadows
Attenuation         attenuation
Float32             hotAngle
Float32             outerAngle
FallOffEnum         fallOff
location
The location of the source of the spot light.
orientation
The orientation of the cone of light emitted by the spot light. The direction of this vector is toward the light source. This vector should be normalized.
castsShadows
A value of True specifies that objects illuminated by the light are to cast shadows; a value of False indicates that objects illuminated by the light are not to cast shadows.
attenuation
This structure determines the amount that the intensity of the light diminishes over distance. See "Attenuation and Fall-Off Values" , for a description of this structure.
hotAngle
The half-angle (specified in radians) from the center of the cone of light within which the light remains at constant full intensity. The value in this field should be in the half-open interval [0, p/2).
outerAngle
The half-angle (specified in radians) from the center to the edge of the cone of the spot light. The value in this field should be in the half-open interval [0, p/2), and should not be less than the value in the hotAngle field.
fallOff
The fall-off value for the spot light. The value in this field determines the manner of attenuation of the light from the edge of the hot angle to the edge of the outer angle. See "Attenuation and Fall-Off Values" , for a description of the constants that can be used in this field.

Data Size

44

Description

A spot light is a light source that emits a circular cone of light in a specific direction from a specific location. Every spot light has a hot angle and an outer angle that together define the shape of the cone of light and the amount of attenuation that occurs from the center of the cone to the edge of the cone. The attenuation of the light's intensity from the edge of the hot angle to the edge of the outer angle is determined by the light's fall-off value.

Some style objects also specify whether or not objects in a scene shall receive shadows. Thus, conflicting shadowing instructions can be sent to a renderer. The outcome in such a case is renderer-specific, application-specific, or both.

Parent Hierarchy

Shared, shape, light.

Parent Objects

None.

Child Objects

Light data. If no child object is specified, the light should have the properties specified in the default setting of a light data object.

Example

Container (
    SpotLight (
        0 9 0                       # location
        0 1 0                       # orientation
        True                        # castsShadows
        0 0 1                       # attenuation
        0.3                         # hotAngle
        0.5                         # outerAngle
        Linear                      # fallOff
    )
    LightData ( ... )
)

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |